package com.yantong.constant;

import java.util.*;

/**
 *余额历史记录类型
 * @author kanghaixin
 * 1、用户提现2、用户提现失败3、用户充值4、用户扣款5、团长发佣金6、团长提现7、团长提现失败8、团长充值9、团长扣款10、团长退款
 * 11、供应商货款结算12、供应商提现13、供应商提现失败14、供应商充值15、供应商扣款16、用户提现申请17、团长提现申请18、供应商提现申请
 * 19、供应商保证金缴纳、20、供应商保证金退至余额
 * @date 2018/9/19.11:06
 */
public enum BalanceLogFlowType {
    yonghutixian("1", "用户提现"),
    yonghutixianshibai("2", "用户提现失败"),
    yonghuchongzhi("3", "用户充值"),
    yonghukoukuang("4", "用户扣款"),
    tuanzhangfayongjin("5", "团长发佣金"),
    tuanzhangtixian("6", "团长提现"),
    tuanzhangtixianshibai("7", "团长提现失败"),
    tuanzhangchongzhi("8", "团长充值"),
    tuanzhangkoukuang("9", "团长扣款"),
    tuanzhangtuikuang("10", "团长退款"),
    gongyingshangjiesuan("11", "供应商货款结算"),
    gongyingshangtixian("12", "供应商提现"),
    gongyingshangtixianshibai("13", "供应商提现失败"),
    gongyingshangchongzhi ("14", "供应商充值"),
    gongyingshangtuikuang ("15", "供应商扣款"),
    yonghutixianshengqing ("16", "用户提现申请"),
    tuanzhangtixianshengqing ("17", "团长提现申请"),
    gongyingshangtixianshengqing ("18", "供应商提现申请"),
    gongyingshangbaozhengjingjiaona ("19", "供应商保证金缴纳"),
    gongyingshangbaozhengjingtuihui ("20", "供应商保证金退至余额"),
    branch_office_profit ("21", "订单分润分公司结算"),
    agent_profit ("22", "订单分润代理结算"),
    BanBPay ("23", "电子钱包"),
    MARKETING_GROUP ("24", "抢购拼团失败奖励"),
    REGISTERED ("25", "新用户注册赠送"),
    AUTO_RELEASE ("26", "用户额度自动释放"),
    PAY_PACKAGE_SETTLEMENT("27", "大礼包结算余额"),
    JUHE_SETTLEMENT("28", "聚合支付结算余额"),
    TEAM_SETTLEMENT("29", "门店售卖结算")
    ;

    private String code;

    private String name;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private static Map<String, String> all= new HashMap<>();
    static{
        for(BalanceLogFlowType balanceLogStyle: EnumSet.allOf(BalanceLogFlowType.class)){
            all.put(balanceLogStyle.code, balanceLogStyle.name);
        }
    }

    public static String get(String code) {
        return all.get(code);
    }

    public static List<Map<String,Object>> getBalanceLogStyles() {
        List<Map<String,Object>> list = new ArrayList<>();
        for (BalanceLogFlowType style: BalanceLogFlowType.values()) {
            Map<String,Object> map = new HashMap<>();
            map.put("code", style.getCode());
            map.put("name", style.getName());
            list.add(map);
        }
        return list;
    }
    BalanceLogFlowType(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
